<div id="resultSet">
  <table>
    <tr>
      <th <%= sort_td_class_helper "id" %>> <%= sort_link_helper "ID", "id" %></th>
      <th <%= sort_td_class_helper "status" %>><%= sort_link_helper "Status", "status" %></th>
      <th <%= sort_td_class_helper "gender" %>><%= sort_link_helper "Gender", "gender" %></th>
      <th <%= sort_td_class_helper "region" %>><%= sort_link_helper "Region", "region" %></th>
      <% if (@show_yls) %>
        <th <%= sort_td_class_helper "yls-score" %>><%= sort_link_helper "YLS-score", "yls-score" %></th>
      <% end %>
      <th <%= sort_td_class_helper "birthdate" %>><%= sort_link_helper "Birthdate", "birthdate" %></th>
      <th <%= sort_td_class_helper "group" %>><%= sort_link_helper "Group", "group" %></th>
      <th <%= sort_td_class_helper "institution" %>><%= sort_link_helper "Institution", "institution" %></th>
      <th <%= sort_td_class_helper "comment" %>><%= sort_link_helper "Comment", "comment" %></th>
    </tr>


    <% @youths.each do |y| %>
      <tr class="<%= get_next_result_set_type %>">
        <td><%= link_to sprintf("%03d", y.id), :action => "edit", :id => y.id %></td>
        <td><%= y.youth_status.name %></td>
        <td><%= y.gender %></td>
        <td><%= y.region.name %></td>
        <% if (@show_yls) %>
          <td><%= y.yls_score %></td>
        <% end %>
        <td><%= y.birthdate %></td>
        <td><%= y.youth_group.name %></td>
        <td><%= y.institution.nil? ? "" : y.institution.name %></td>

        <% comment = y.comment[0, 20] %>
        <% if (y.comment.length > 20) %>
          <% comment = comment + '[...]' %>
        <% end %>

        <td><acronym title="<%= y.comment %>"><%= comment %></acronym></td>
      </tr>
    <% end %>
  </table>
  <b><%= @youths.size %> cases total</b>
</div>
